
#include <iostream>
#include <string.h>
#include <unistd.h>

using namespace std;

class Human {
private:
	int a;
public:	
	virtual void eating(void) {cout << " use hand to eat " << endl;}

};

class Englishman : public Human {
public:
	void eating(void) {cout << " use knife to eat " << endl;}
};

class chineseman : public Human {
public:
	void eating(void) {cout << " use chopsticks to eat " << endl;}
};

void test_eating(Human h)
{
	h.eating();
}

int main(int argc , char **argv)
{	
	Human h;
	Englishman e;
	chineseman c;

	test_eating(h);
	test_eating(e);
	test_eating(c);

	cout << "sizeof Human = " << sizeof(h) <<endl;
	cout << "sizeof Englishman = " << sizeof(e) <<endl;
	cout << "sizeof chineseman = " << sizeof(c) <<endl;
	
	return 0;
}






















